<?PHP

	require 'includes/master.inc.php';

	$return = pick_off();
	
	
	// IF PAGE ISN'T SET JUST SET IT TO HOME, OR WHATEVER DEFAULT YOU WANT TO CHANGE IT TO
	if(empty($return['0']))
		$return['0'] = 'home';
		
		
		if(deslugify($return['0']) === 'admin' && !isset($return['1']))
			$return['1'] = 'home';

	
	// LOADS CONTROLLER IF IT EXISTS
	if(!isset($data['skip']))
	{
			if(deslugify($return['0']) === 'admin' && file_exists('controls/admin/'.deslugify($return['1']).'.control.php'))
				include 'controls/admin/'.deslugify($return['1']).'.control.php';
		
				elseif(file_exists('controls/'.deslugify($return['0']).'.control.php'))
					include 'controls/'.deslugify($return['0']).'.control.php';
	}
	
		// IF YOU DON'T WANT TO AUTO INCLUDE SET $data['skip'] IN CONTROLLER
		if(!isset($data['skip']))
		{
				if(deslugify($return['0']) === 'admin' && file_exists('views/admin/'.deslugify($return['1']).'.thtml'))
					$load->view(deslugify($return['1']));
					
					elseif(file_exists('views/'.deslugify($return['0']).'.thtml'))
						$load->view(deslugify($return['0']));
		}